Integrate Campaign with External System

This use case describes how to integrate SessionM, including a campaign, with a third-party external system such as a messaging platform. SessionM can integrate with the messaging platform by understanding what is required for the payload being sent to it via webhook. Once understood, these requirements help determine what events a SessionM campaign must listen for to trigger sending the payload to the external system.

Configuring this relationship between the two platforms enables a customer to execute an action on SessionM that triggers the messaging platform to send the customer a message. When customers act, they do so as part of a campaign that is listening for an event that fires for the customer action. Two types of actions are typically supported in these campaigns: a transaction such as a purchase; or an event such as clicking a button or opening a page.

Alternatively, you can also send a message to a customer that is not triggered by an action. A campaign can be scheduled to trigger the sending of the payload to the messaging platform via webhook.

If you want to send a loyalty message - triggered by an action or a schedule - from a third-party provider, you must send corresponding events to SessionM via API or batch methods. The SessionM team is responsible for building connectivity to your third-party integration.

Before commencing work on an integration with a messaging platform, consult with your SessionM representative about existing integrations with SendGrid, Salesforce Marketing Cloud, Klaviyo, Mailchimp, Adobe, Cheetah, Twilio, Urban Airship, and Mparticle.

Customer Journey

One helpful way of understanding this use case is to consider how it reflects the customer's experience, or journey, in the "real world."

Customer completes action for loyalty program on home goods website, buying dish set

SessionM evaluates if action makes customer eligible for campaign outcome

If so, SessionM responds, communicating with external system - messaging platform

SessionM can request that system send message or award loyalty outcome (points, offers, tags, events)

In this instance, messaging platform is asked to send message to customer

Customer receives message about action they took on retailer's website

Messaging platform can also send data on customer action to SessionM via webhook

Alternatively, message can be scheduled via campaign rather than triggered by customer action

Platform Configuration

Before implementing this use case, work with SessionM to create a provider for the messaging platform you want to use. Then ensure the following have been configured:

Customers

Customer profile created/updated in environment.

Campaigns

Webhook with third-party integration details and API information provided by client.

SessionM campaign with Webhook for third party integration:

  • Ensure campaign has more than 1 customer in the audience

  • Ensure that campaign has a status of "Live" and is scheduled with a timeframe.

In order to send an external message, a provider, a template, and a variant must be created. For more information, please work with your SessionM delivery team to define requirements pertaining to your third-party integration.

If you choose to implement an alternative flow for this use case - one that triggers a messaging platform via a scheduled campaign - ensure that the campaign scheduling attributes are set.

Sequence Diagrams

See the overall flow for this use case below.

CUSTOMER CUSTOMER CLIENT MIDDLEWARE CLIENT MIDDLEWARE SESSIONM SESSIONM EXTERNAL SYSTEM EXTERNAL SYSTEM INTEGRATE CAMPAIGN WITH EXTERNAL SYSTEM 1 Complete action in campaign for loyalty program 2 Request  campaign transaction orcampaign event be executed on platform 3 Evaluate campaign eligibility against relevant rule sets 4 Enqueue message 5 Send webhook via message payload Payload contains template to trigger or loyalty outcome to award 6 Send message to customer via email, SMS, or push

Alternatively, messages sent from an external system can be scheduled rather than triggered by an action. The first event of the sequence above depicts a customer completing a loyalty program action. But, often, customers are part of a scheduled campaign defined for a particular audience. As such, they do not complete any action, making steps 1 and 2 irrelevant.

See the alternative flow for this use case below.

CUSTOMER CUSTOMER CLIENT MIDDLEWARE CLIENT MIDDLEWARE SESSIONM SESSIONM EXTERNAL SYSTEM EXTERNAL SYSTEM ALTERNATIVE WAY TO INTEGRATE CAMPAIGN WITH EXTERNAL SYSTEM 1 Execute scheduled sending of message from campaign 2 Enqueue message 3 Send webhook via message payload, with template to trigger or loyalty outcome to award 4 Send message to customer via email, SMS, or push

Best Practices

When sending a transaction, do so asynchronously to not slow down queue processing speeds.

When working with SessionM to create a webhook for a messaging platform, be sure to create a provider, a template and a variant. Please see the provider example below for SendGrid:

Copy

SendGrid provider code

{
    "name": "SendGrid simulator - {{$guid}}",
    "channel": "email",
    "provider": "sendgrid",
    "provider_config": 
        {
        "api_key":  "SG.12345",
        "host": "https://messaging-testsinkd.{{tenant}}.local/sendgrid"
        }
}

Before consulting with the SessionM team, please prepare the following information:

  • API method, endpoint, and request body.
  • Authentication method.
  • Rate limits.
  • Error responses.

Only support REST APIs and unidirectional flows. If you want to receive event data back from your messaging provider such as, EmailOpen or ClicData, please consult your SessionM team.